﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Welcome.aspx.cs" Inherits="Web.View.Welcome" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>桌面</title>
    <script type="text/javascript">
        function ShowDetails(id, type) {
            if (type == 0) {
                Details_Win.title = Notice_Store.getAt(id).get('newstitle');
                document.getElementById("header").innerHTML = Notice_Store.getAt(id).get('newstitle');
                document.getElementById("content").innerHTML = Notice_Store.getAt(id).get('newscontent');
                document.getElementById("author").innerHTML = Notice_Store.getAt(id).get('newsowner') + "    " + Notice_Store.getAt(id).get('newstime');
            } else {
                Details_Win.title = News_store.getAt(id).get('newstitle');
                document.getElementById("header").innerHTML =  News_store.getAt(id).get('newstitle') ;
                document.getElementById("content").innerHTML = News_store.getAt(id).get('newscontent');
                document.getElementById("author").innerHTML = News_store.getAt(id).get('newsowner') + "    " + Notice_Store.getAt(id).get('newstime');
            }
        }
    </script>
</head>
<body style="margin:0px; padding:0px;background:url(/View/images/bgmain.png) left bottom repeat-x;">
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />

    <ext:Store ID="Notice_Store" runat="server" OnRefreshData="NoticeInfoBind" AutoLoad="true">
         <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="newsid">
                <Fields>
                    <ext:RecordField Name="newsid" />
                    <ext:RecordField Name="newsclassify" />
                    <ext:RecordField Name="newstitle" />
                    <ext:RecordField Name="newscontent" />
                    <ext:RecordField Name="newstime" />
                    <ext:RecordField Name="newsowner" />
                    <ext:RecordField Name="newsdesc" />
                </Fields>
            </ext:JsonReader>
        </Reader> 
    </ext:Store>

     <ext:Store ID="News_store" runat="server" OnRefreshData="NewsInfoBind" AutoLoad="true">
         <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="newsid">
                <Fields>
                    <ext:RecordField Name="newsid" />
                    <ext:RecordField Name="newsclassify" />
                    <ext:RecordField Name="newstitle" />
                    <ext:RecordField Name="newscontent" />
                    <ext:RecordField Name="newstime" />
                    <ext:RecordField Name="newsowner" />
                    <ext:RecordField Name="newsdesc" />
                </Fields>
            </ext:JsonReader>
        </Reader> 
    </ext:Store>

    <ext:Viewport ID="MainView" StyleSpec="background-color: transparent;" runat="server" >
        <Items>
            <ext:FitLayout runat="server">
                <Items>
                    <ext:Panel Frame="false" runat="server" BodyStyle="background-color: transparent;" Icon="Vcard" Header="false" 
                        Layout="Fit">
                        <Items>
                            <ext:Portal ID="Portal1" BodyStyle="background-color: transparent;" runat="server" Border="false"
                                Layout="Column">
                                <Items>
                                    <ext:PortalColumn ID="PortalColumn2" runat="server" StyleSpec="padding:10px 0 10px 10px"
                                        ColumnWidth=".5" Layout="Anchor">
                                        <Items>
                                            <ext:Portlet ID="Portlet2" Icon="Sound" Title="通知公告" Height="200px" Collapsible="true" Closable="true" runat="server" >
                                                <Items>
                                                <ext:GridPanel ID="News_Grid" HideHeaders="true" Layout="fit" Height="200px" TrackMouseOver="true" runat="server" StoreID="Notice_Store"
                                                    StripeRows="true" Header="false" Border="false" Collapsible="false">
                                            
                                                <ColumnModel ID="News_ColumnMode" runat="server">
                                                    <Columns>
                                                        <ext:RowNumbererColumn Width="20" />
                                                        <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="newsid" />
                                                        <ext:Column Header="标题" Sortable="true" Width="340" DataIndex="newstitle" />
                                                        <ext:Column Header="发布时间" Sortable="true" Width="125" DataIndex="newstime" />
                                                    </Columns>
                                                </ColumnModel>
                                                <Listeners>
                                                    <RowDblClick Handler="ShowDetails(rowIndex,0);Details_Win.show();" />
                                                </Listeners>
                                                <LoadMask ShowMask="true" Msg="正在加载..." />
                                                </ext:GridPanel>
                                                
                                                </Items>
                                            </ext:Portlet>
                                            <ext:Portlet ID="Portlet3" Icon="WeatherCloudy" Title="天气预报-北京时间" Height="150" Padding="10" runat="server" Html="<center><iframe src='http://m.weather.com.cn/m/pn12/weather.htm ' width='245' height='110' marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'></iframe><iframe width=130 height=110 src='http://s.time.org.cn/newdate/#style:2;color:ff0000;font-size:14px;' frameborder=0 scrolling=no allowTransparency=true></iframe></center>" />
                                        </Items>
                                    </ext:PortalColumn>
                                    <ext:PortalColumn ID="PortalColumn3" runat="server" StyleSpec="padding:10px" ColumnWidth=".5"
                                        Layout="Anchor">
                                        <Items>
                                            <ext:Portlet ID="Portlet4" Icon="Newspaper" Title="新闻资讯" Height="200px" runat="server" >
                                            <Items>
                                                <ext:GridPanel ID="GridPanel1" HideHeaders="true" Layout="fit" Height="200px" TrackMouseOver="true" runat="server" StoreID="News_store"
                                                    StripeRows="true" Header="false" Border="false" Collapsible="false">
                                                <ColumnModel ID="ColumnModel1" runat="server">
                                                    <Columns>
                                                        <ext:RowNumbererColumn Width="20" />
                                                        <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="newsid" />
                                                        <ext:Column Header="标题" Sortable="true" Width="340" DataIndex="newstitle" />
                                                        <ext:Column Header="发布时间" Sortable="true" Width="115" DataIndex="newstime" />
                                                    </Columns>
                                                </ColumnModel>
                                                <Listeners>
                                                    <RowDblClick Handler="ShowDetails(rowIndex,1);Details_Win.show();" />
                                                </Listeners>
                                                <LoadMask ShowMask="true" Msg="正在加载..." />
                                                </ext:GridPanel>
                                                
                                                </Items>
                                            </ext:Portlet>
                                        </Items>
                                    </ext:PortalColumn>
                                </Items>
                            </ext:Portal>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>

    <ext:Window ID="Details_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="详细" AutoScroll="true" Icon="WorldEdit" BodyStyle="background-color:#FFF;" Padding="10" Width="630" Height="400"
        Resizable="true">
        <Content> 
                <div id="header" style="font-size:14px; font-weight:bold; text-align:center;"></div>
                <hr />
                <div id="content"></div>
                <br />
                <br /><hr />
                <p align="right" id="author"></p> 
        </Content>
    </ext:Window>
    </form>
</body>
</html>
